<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>hello vue</title>
</head>
<body>
<div id="app">
    <input type="text" v-model="num">
    <button v-on:click="add">点我++</button><br>
    <button v-on:click="decrement">点我--</button>
    <span>{{num}}</span>
</div>
</body>
<script src="node_modules/vue/dist/vue.js"></script>
<script>
    //创建vue实例
    var app=new Vue({
        el:"#app",
        data:{
            message:'com.zls',
            num:0
        },
        methods:{
            add(){
                this.num++
            },
            decrement:function(){
                this.num--
            }
        },
        //vue创建后,渲染前
        created:function () {
            this.num=1000
        },
        //vue渲染后执行
        mounted:function(){
            this.num=111
        }
    })
</script>
</html>